import { Link, useNavigate } from "react-router-dom";

export default function Login() {
  const navigate = useNavigate();
  return (
    <>
      <div>
        我是登录页
        {/* 声明式跳转 */}
        <Link to="/article">跳转到文章页</Link>
        {/* 命令式跳转 */}
        <button onClick={() => navigate("/article")}>跳转到文章页</button>
        {/* searchParams传参，使用useSearchParams获取 */}
        <button onClick={() => navigate("/article?name=Alice&age=12")}>
          searchParams传参
        </button>
        <button onClick={() => navigate("/article/Jack/22")}>params传参</button>
      </div>
    </>
  );
}
